package com.kefu.call.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kefu.call.model.CallIvrTrail;
import com.kefu.call.service.CallIvrTrailService;
import com.kefu.call.vo.CallIvrTrailSearchVo;
import com.kefu.common.controller.AbstractBaseController;
import com.kefu.common.result.Result;
import com.kefu.common.result.ResultGenerator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "ivr轨迹")
@RestController
@RequestMapping("/call/ivrTrail")
public class CallIvrTrailController extends AbstractBaseController {
    @Resource
    private CallIvrTrailService callIvrTrailService;

    @PostMapping("/list")
    @ApiOperation(value = "ivr轨迹列表", notes = "ivr轨迹列表")
    public Result<Page<CallIvrTrail>> list(@Validated @RequestBody CallIvrTrailSearchVo search) {
        Page<CallIvrTrail> list = callIvrTrailService.searchLambdaPage(search);
        return ResultGenerator.genSuccessResult(list);
    }
}
